As I want to deploy a zip file hosted in a private storage account to Azure App Service by following the method described in this documentation https://learn.microsoft.com/en-us/azure/app-service/deploy-zip?tabs=cli, I get the following error:
"An error occured during deployment. Status Code: 500, Details: {"Message":"An error has occurred.","ExceptionMessage":"Response status code does not indicate success: 404 (The specified resource does not exist.)"
Here is my setup:
Private Azure Storage account with private endpoint
Azure App Service with vnet integration
I generate a SAS at container level and run the command az webapp deploy --resource-group --name --src-url "https://storagesample.blob.core.windows.net/sample-container/myapp.zip?SASTOKEN"
Do you have any idea on the cause of this issue?
Thank you.
Related
I have no experience in coding, just started now.
I am trying to create a webapp using the Azure Cloud Shell, so I used the following command:
az webapp create --name WebAppOne --resource-group learn-64c4ca17-0293-40f6-ba23-e4581751cca0 --plan ServicePlanTest
Then I get the message:
Webapp 'WebAppOne' already exists. The command will use the existing app's settings.
Unable to retrieve details of the existing app 'WebAppOne'. Please check that the app is a part of the current subscription
I only have one subscription in Azure as I am still using a free account for learning purposes.
So, I decided to get a list showing the webapps that exist by using the command:
az webapp list --output table
However, the only outcome is a blank line, showing no web apps already existing. What should I try next?
To create a web app in Azure App service, you must have a resource group and App service plan in your subscription.
To check the existing App services in your subscription
az webapp list --resource-group MyRGName
Output :
As you can see, currently I don't have any webapps created in the given Resource group
Run the below command to create an Azure Web App
az webapp create --name MyWebApp --resource-group MyRGName --plan MyAppServicePlan
Though I don't have any Webapps with the given name, I got the same error.
In Azure Portal => Azure Active Directory => App registrations => All applications
In search box, searched with the web app name. I can see the web app with same name is already created.
Reason for the error
You might have created a web app with same name long ago, but the resource got deleted from the resource group. But still, it is available in the Azure Active Directory App registrations.
If it is created by you and you don't want to use anymore, you can delete it. If not create web app with another name.
Tried to create web app with another name.
Create Azure App Service:
Now I can see the created Web App List.
List of Azure Web Apps
I have install azure cli plugins in jenkins after that i setup Azure Service Principal and got Successfully verified the Microsoft Azure Service Principal after that i create a new job and added az version to check az is installed or not in it and got failed error below is the screenshot of that error
Note:- My Jenkins is having v2.332.1 and installed in AKS Cluster as a Helm chat my jenkins is running
Here is the screenshot of plugin installed
Here is the my job new create in freestylejob
Please help out with this issue
You need to install azure cli in the Jenkins Host as well.
from
https://plugins.jenkins.io/azure-cli/ - Prerequisites
To use this plugin, first you need to have an Azure Service Principal
in your Jenkins instance.
1.Create an Azure Service Principal through Azure CLI or Azure portal.
2.Open Jenkins dashboard, go to Credentials, add a new Microsoft Azure Service Principal with the credential information you just created.
3.Install Azure CLI in the Jenkins Host
from your description, I can see you have 1,2 steps completed and possibly 3 is missing.
I'm trying to Connect a Azure Webb app (containers) to an Azure Container Registry Using the Azure CLI. I have an Azure Container Registry located in the same Ressouce Group as the Webb App.
My command looks like this:
az webapp config container set --name "containerbugdemo" --resource-group "Containerbug" --docker-custom-image-name "application/helloworld:latest" --docker-registry-server-url "https://"$arcName.azurecr.io" --docker-registry-server-password "****" --docker-registry-server-user "***"
After running the command the container settings blade shows the following error:
Failed to get a list of tags.
And the Container fails to get pulled by the WebApp.
If I try the same procedure only using the graphical interface through the Azure portal, everything works as expected.
It seems you set the wrong image name. If you use the image in the ACR, you need to set the image name as acrname.azurecr.io/repository:tag, both when you create the web app and container setting, not just repository:tag. And the server URL is also a mistake that one more double quote in the question.
I want to find out is it possible to deploy classic cloud service package (Microsoft.ClassicCompute) to Azure deployment slot with AZ powershell.
There is a classic service inside a resource group already created in Azure. A package that is going to be deployed is uploaded to a separate Storage Profile blob.
Currently, the webroles are deployed using REST API. An appropriate path to a package in the blob is specified in element of a post request and this works fine.
I am trying to do the same thing using AZ powershell, particulary, by calling New-AzResource cmdlet with '-PropertyObject' parameter specified like that:
#{
deploymentLabel = 'XXX';
configuration = '<?xml version=\"1.0\" encoding=\"utf-8\"?> .... ';
packageUrl = '{valid_url_to_package}';
....
}
but an error returns:
The request content was invalid and could not be deserialized: 'Could
not find member 'packageUrl' on object of type
'DeploymentSlotProperties'. Path 'properties.packageUrl'
If to remove 'packageUrl' property from the object and execute the cmdlet again an another error is shown up:
The deployment request is missing the package link.
Unfortunately, I cannot find any any information about format of '-PropertyObject' parameter. Or maybe there is a better way to deploy a package via AZ?
According to my research, Azure PowerShell Az module is used to manage Azure ARM resource. But Azure Cloud service is Classic resource. So we cannot deploy azure cloud service with az module. For more details, please refer to the document and issue. If you want to know to deploy Azure cloud service with PowerShell, please refer to https://github.com/MicrosoftDocs/azure-cloud-services-files/tree/master/Scripts/cloud-services-continuous-delivery
I have a PowerShell script which creates an azure function app on a consumption plan and its associated storage account within a resource group using the azure cli following the example In the Microsoft Docs
However to enable application insights I have to go to the azure portal, find the func select monitor and click enable application insights.
How can I expand that script to enable automate this step for the newly created function? I have been unable to find any specific documentation or examples and I would prefer to avoid resource templates if possible.
OF course, you could enable Application Insights to the azure function by Azure CLI.
But you need to create the Application Insights in the portal first, currently, it is unable to create Application Insights via Azure CLI.
You could follow the steps below.
1.Go to your Application Insights in the portal, copy the Instrumentation Key in the screenshot.
2.After creating the function app by your command , just use the CLI command below.
az functionapp config appsettings set --name <functionname> --resource-group <resourcegroupname> --settings 'APPINSIGHTS_INSTRUMENTATIONKEY = <Instrumentation Key>'
It works fine on my side, you could check it in the portal.