azure-powershell

New-PSSession in an Azure-runbook: Access denied (ARM)

家住魔仙堡 提交于 2019-12-24 09:58:25
问题 With the advice provided in this answer I was able to set up the winrm on a Azure VM(1). Right now, I can open a PS-Session with New-PSSession from any Azure VM(2) to the Azure VM(1) my local machine which to the Azure VM(1) But if I do exactly the same within an Azure runbook, $cred = Get-AutomationPSCredential -Name "admin" InlineScript { $vmSession = New-PSSession -ConnectionUri 'https://xxx.yyy.cloudapp.azure.com:5986' -Credential $cred -SessionOption (New-PSSessionOption -SkipCACheck

“Object reference not set to an instance of an object” when I try to deploy my Azure Cloud Service via CLI

孤者浪人 提交于 2019-12-24 03:24:24
问题 I'm running this command in the Azure PowerShell to deploy my node project: Publish-AzureServiceProject -ServiceName <name> -Location "East US" Using my service name instead of <name> . Each time I run this, I get an error: Publish-AzureServiceProject : Object reference not set to an instance of an object. At line:1 char:1 + Publish-AzureServiceProject -ServiceName <name> -Location "East US" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo :

Is it possible to create clone/image from a resource manager based Azure VM?

大兔子大兔子 提交于 2019-12-23 19:40:30
问题 I have a working resource manager based VM. (Ubuntu) Now I customized it in several way, and would like to have it as a start template in the future when creating new VMs. Basically I would like to as easily create a new VM from my customized VM as I created it from initially via Azure portal by picking a LAMP VM by bitnami. Please note, I am aware the Linux/Windows provisioning/deprovisioning process. In fact I can accept and use scenario where the machine was not deprovisioned and simply

List directories in a container

99封情书 提交于 2019-12-23 17:05:26
问题 How can I get a list of directories in my container? I can use Get-AzureStorageBlob to get all the blobs and filter by distinct prefix /name/, but it might be slow with millions of blobs. Is there a proper way of achieving this in PowerShell? 回答1: There's no concept of directories, only containers and blobs. A blob name may have delimiters with look like directories, and may be filtered . If you choose to store millions of blobs in a container, then you'll be searching through millions of

How do I find the Azure PowerShell version?

◇◆丶佛笑我妖孽 提交于 2019-12-23 07:19:13
问题 I need to find the installed Azure PowerShell version through cmdlets code. How do I find the Azure PowerShell version? Note: Other than cmdlets code is also welcome. 回答1: This PowerShell cmdlet will get the Azure PowerShell version. Get-Module -ListAvailable -Name Azure -Refresh It has a major advantage in which it will be able to return the expected outcome even if the Azure module has not been loaded into the current PowerShell session. On the contrary, (Get-Module Azure).Version will only

How to download a blob file from Azure Storage and save it to an FTP server using Powershell?

偶尔善良 提交于 2019-12-23 05:16:22
问题 I am trying to access a blob file in PowerShell and want to save it directly to an FTP server. How can this be done? Can this be done via the blob file URL? Or can I somehow have the file created in Powershell memory and then use $webclient.UploadFile to save it to FTP folder? Another question related to this same download is that is there a way to just copy the file instead of getting the subdirectories copied as well? For example, I have a blob file like: dataload/files/my_blob_file. When I

Error when using CmdLet New-AzureRmADAppCredential to create new credential with certificates

让人想犯罪 __ 提交于 2019-12-23 02:57:15
问题 I am trying to use the New-AzureRmADAppCredential cmdlet. I am trying to create a new credential using the following syntax: New-SelfSignedCertificateEx -Subject "CN=$ClientId" -KeySpec "Exchange" -FriendlyName "$ClientId" $start = (Get-Date).ToUniversalTime() $end = $start.AddDays(4) New-AzureRmADAppCredential -ApplicationId $application.ObjectId -CertValue $keyValue -StartDate $start -EndDate $end I've noticed that if I try to create a new credential with a certificate, it failed on a

get list of available ip addresses in subnet

南笙酒味 提交于 2019-12-22 18:06:08
问题 How can i get the list of available ip address in a subnet? I was able to get the list of all ip addresses but not able to check if the ip address is already utilized. for some reason the below command doesn't work. Test-AzureRmPrivateIPAddressAvailability Thanks in adavance. 回答1: I have the following example and it is working as expected. I am using ` backtick character to separate my commands into multiple lines. $vNetName = "myvirtualnetworkname" $resourceGroupName = "myresourcegroup" Get

Set-AzContext works in Azure Cloud Shell but doesn't in Azure PowerShell

我是研究僧i 提交于 2019-12-22 17:08:29
问题 When i execute following command Clear-AzureProfile Connect-AzAccount -TenantID xxxxxxxxxxxxxxxxxxx Set-AzContext -SubscriptionId xxxxxxxxxxxxxxxxxxx in Azure PowerShell i get this error. Set-AzContext : Please provide a valid tenant or a valid subscription. At line:6 char:1 + Set-AzContext -SubscriptionId xxxxxxxxxxxxxxxxxxx and if i run the same command in Azure Cloud Shell it works Name Account SubscriptionName Environment TenantId xxxx xxxxxxx xxxx xxxx xxxx I switched from free-trial to

Create a ~~consumption~~ based App Service Plan with Powershell

北城以北 提交于 2019-12-22 06:46:52
问题 I found this answer for the question : It's possible to create App Service Plans using Azure Powershell? Does anyone know how to create a CONSUMPTION app-service-plan with Azure? When I look at the properties (using https://resources.azure.com/ ) of one I made (by the Gui), I see the following properties; }, "sku": { "name": "Y1", "tier": "Dynamic", "size": "Y1", "family": "Y", "capacity": 0 } { "id": "/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/MyResourceGroup/providers/Microsoft