I am deploying a static react web app into azure static website (blob storage) using the command
While doing so I am doing it through Azure CLI (Inline command).
az storage blob upload-batch -s ./ -d '$web' \
--account-name <storage_acct_name> \
--account-key <storage_acct_key>
This command gives me an error
2022-11-17T08:27:29.5243851Z ERROR: Failed to connect to MSI. Please make sure MSI is configured correctly.
2022-11-17T08:27:29.5244667Z Get Token request returned http error: 400, reason: Bad Request
2022-11-17T08:27:29.5274714Z ##[error]Error Code: [1]
2022-11-17T08:27:29.5283948Z ##[error]Error: Azure login failed using Managed Service Identity
2022-11-17T08:27:29.5285668Z ##[error]Script failed with error: ERROR: Failed to connect to MSI. Please make sure MSI is configured correctly.
What could be possible solution to get over this issue.
I tried in my environment and successfully deployed static web app in $Web.
Before running the command make sure you have logged in with current credentials:
az login --tenant xxxx-xxxxxxxxxxxxxx-xxxxx”
Command:
az storage blob upload-batch -d '$web' -s < path > --account-name <account name > --account-key "<account key>
Console:
Portal:
Reference:
azure - Configuration of Managed Service Identity(MSI) - Stack Overflow for pipeline problems.
Getting token from Cloud Shell intermittently fails with 400 Client Error: Bad Request · Issue #11749 · Azure/azure-cli · GitHub
I am deploying ADF linked templates from ADLS through GitHub Actions and pipeline fails withy generic Python error:
ERROR: 'str' object has no attribute 'get'
INFO: Command ran in 1.201 seconds (init: 0.389, invoke: 0.812)
Error: Process completed with exit code 1.
Deployment command is:
az deployment group create
--resource-group $ADF_RESOURCE_GROUP
--name $ADF_DEPLOYMENT_NAME
--what-if
--what-if-result-format ResourceIdOnly
--template-uri $TEMPLATE_URI
--query-string $SAS_TOKEN
--parameters factoryName=$FACTORY_NAME
What-if part is only for debugging purposes.
Here is official documentation
This command fails
az webapp create --resource-group my-rg -n my-app --plan my-plan
with error
ResourceNotFound - The Resource 'Microsoft.Web/sites/my-app'
under resource group 'my-rg' was not found.
To me this doesn't make sense. The very purpose of this command is to create the webapp, so obviously it should not expect it to exist before executing the command. Did I miss somthing ?
What I think is happening - the App Service name is already taken and it spits out this silly error, try changing the name to something unique and it will work.
ps. figured it out with a --debug added to the command
When trying to run terraform locally with azurerm provider on my machine, I receive this error :
Error: Error building account: Error getting authenticated object ID: Error parsing json result from the Azure CLI: Error waiting for the Azure CLI: exit status 1
I followed this link :
https://github.com/terraform-providers/terraform-provider-azurerm/issues/3686#issuecomment-523983734
but the az account get-access-token works.
Any ideas?
Since my organization is using a self-signed certificate to control internet traffic, the az cli is not working as usual. To diagnose, you should run this command :
az ad signed-in-user show
It will show you a very clear message to workaround this issue.
https://github.com/Azure/azure-cli/blob/dev/doc/use_cli_effectively.md#working-behind-a-proxy
I exported the CA certificate from any website from Chrome in Base64 and copied the string in the pem file as indicated in the previous link. It worked!
On Windows :
Append the certificate in C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\certifi\cacert.pem
Hope this helps someone!
Run az login again, it's worked for me!
I had this but the az ad signed-in-user show worked and the Azure CLI was up-to-date.
Terraform uses the command-line under-the-hood, but my terminal had additional lines injected in at the start (versioning, aliases/doskey), which is the bit that terraform was complaining about, rather than the Azure CLI. So I turned that off and it started working.
I had this issue as well. After looking through the link you provided, and trying various commands, including az logout and az login, it still was not working. az ad signed-in-user show did not show any errors or non-json output and my token was not expired, however when I ran az extension --help, I noticed a message that there was an update available for the azure cli.
So, what ended up working for me was to update the azure cli from 2.41.0 to 2.42.0. I did this via Homebrew, rather than the command given by the cli itself. Once I did that and then ran az login again, my terraform plan command worked without issues.
I am trying azure group command using cli. its giving me error:
error: Deployment provisioning state was not successful
Below is the command i am using:
azure group deployment create -g "Default" --template-uri https://raw.githubusercontent.com/reshmai/azure/master/testmitheshgithubdb.json
For more info : When i tried with different uri with not given serverName. Its successfully created, but with serverName its not getting created, error is throwing.