I have created a function app against a new consumption plan with the following command:
az functionapp create
--resource-group myresourcegroup
--storage-account mystorageaccount
--name myfunctionapp
--runtime node
--consumption-plan-location northeurope
This creates the function app correctly, but the app service plan is called NorthEuropePlan, which does not meet the naming guidelines I am following. I cannot see anything in the docs that will allow me to change this name.
Therefore, I would like to create the app service plan before, as a consumption plan (tier Y1 Dynamic), and then create a function app against this plan.
az resource create
--resource-group myresourcegroup
--name myconsumptionplan
--resource-type Microsoft.web/serverfarms
--is-full-object
--properties "{\"location\":\"northeurope\",\"sku\":{\"name\":\"Y1\",\"tier\":\"Dynamic\"}}"
That command works correctly, and creates me an app service plan. However, when I try to use that plan (substituting --consumption-plan-location northeurope for --plan myconsumptionplan), I get this error:
There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it.
Do I need to specify some more configuration when I make the app service plan?
When I run az appservice plan show against NorthEuropePlan and myconsumptionplan, the only difference in the object that comes back is the name.
When you are using --plan I believe the run time will think it is an App Service Plan and will configure Always ON which is not allowed in consumption plan so I guess you cannot do it like the way you are doing.
You can achieve it with ARM template though. Below is the example command:
az group create
--name ExampleGroup
--location "North Europe"
az group deployment create
--name ExampleDeployment
--resource-group ExampleGroup
--template-uri "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-function-app-create-dynamic/azuredeploy.json"
The URL mentioned in the template-uri is sample template which will create consumption-pan, storage and functionapp.
Deployment will ask the name of parameters (appName) at runtime.
Related
I created Databricks workspace using Azure CLI:
az databricks workspace create
--name myprj-t-dbx
--location canadacentral
--resource-group rg-myprj-t
--managed-resource-group myprj-t-dbx-mrg
--sku Premium
--private-subnet /subscriptions/2208da08-xxxxxxxxxxx27/resourceGroups/rg-da-t-vnet/providers/Microsoft.Network/virtualNetworks/da-t-vnet/subnets/myprj-dbx-priv-t-snet
--public-subnet /subscriptions/2208da08-xxxxxxxxxxx27/resourceGroups/rg-da-t-vnet/providers/Microsoft.Network/virtualNetworks/da-t-vnet/subnets/myprj-dbx-publ-t-snet
The subnets are created in advance by our network engineers.
They want me to use private endpoints on vnet to connect to the workspace.
When I try to create it (using a third subnet):
az network private-endpoint create
--name myprj-t-dbx-pep
--connection-name myprj-t-dbx-pepc
--private-connection-resource-id /subscriptions/2208da08xxxxxxxxxx27/resourceGroups/rg-myprj-t/providers/Microsoft.Databricks/workspaces/myprj-t-dbx
--subnet /subscriptions/2208da08-xxxxxxxxxxx27/resourceGroups/rg-da-t-vnet/providers/Microsoft.Network/virtualNetworks/da-t-vnet/subnets/myprj-t-snet
--group-id web
--resource-group rg-myprj-t
I get:
ERROR: (NonVNetInjectedWorkspaceNotSupported) Call to Microsoft.Databricks/workspaces failed.
Error message: The workspace 'myprj-t-dbx' is not custom VNet injected.
Currently only custom VNet injected workspaces can create private endpoint connection
I think that you're missing the --vnet argument to the az databricks workspace create. You need to provide name of the VNet as well.
P.S. I would also recommend to pass --enable-no-public-ip to avoid having public IPs for the cluster nodes
I've changed the way that I am creating Databricks workspace.
Instead of regular Azure CLI that creates workspace
az databricks workspace create...
I've used a template with VNet injection from https://rajanieshkaushikk.com/2020/12/05/how-to-deploy-databricks-in-your-private-vnet-without-exposing-public-ip-address-vnet-injection/
also using CLI:
az deployment group create
--name DatabriksVNetInj
--resource-group rg-myprj-test
--template-file ./Databricks-ARM/azuredeploy.json
--parameters workspaceName=myproj-t-dbx...
Just want to know how can I get the service buses in the portal through powershell
I was able to access the app insights through this piece of script
az monitor app-insights component show | ConvertFrom-Json
Now I wish to access the service bus , app service and app service plans as well through powershell
I was using this
az monitor servicebus component show | ConvertFrom-Json
for service bus but it is not working.
You are using Azure CLI there, not the PowerShell modules.
If you want to list / show the details around the following services, then you need to use the corresponding Azure CLI commands:
ServiceBus
az servicebus namespace show --resource-group myresourcegroup --name mynamespace
Reference: https://learn.microsoft.com/en-us/cli/azure/servicebus/namespace?view=azure-cli-latest#az-servicebus-namespace-show
App Service
az webapp show --name MyWebapp --resource-group MyResourceGroup
Reference: https://learn.microsoft.com/en-us/cli/azure/webapp?view=azure-cli-latest#az-webapp-show
App Service Plans
az appservice plan show --name MyAppServicePlan --resource-group MyResourceGroup
Reference: https://learn.microsoft.com/en-us/cli/azure/appservice/plan?view=azure-cli-latest#az-appservice-plan-show
Here is the full CLI reference: https://learn.microsoft.com/en-us/cli/azure/reference-index?view=azure-cli-latest
To get service bus namespace list in your current subscription, you use below command:
az servicebus namespace list
To get the service bus queue list you below command:
az servicebus queue list --resource-group myresourcegroup --namespace-name mynamespace
If you want for topic, keep topic in place of queue in above command.
If you want to get app service plans use the below command:
az appservice plan list
Alternatively, you can use azure resource graph query like below for servicebus:
resources
| where type =~ 'microsoft.servicebus/namespaces'
You can use azure resource graph query like below to get app services:
resources
| where type == 'microsoft.web/sites'
References taken from:
https://learn.microsoft.com/en-us/cli/azure/appservice/plan?view=azure-cli-latest#az-appservice-plan-list
https://learn.microsoft.com/en-us/cli/azure/servicebus?view=azure-cli-latest
Edit:
Yes if you want apim use below query:
resources
| where type == "microsoft.apimanagement/service"
Get apim Using cli :
az account set -s "Subscription name"
$Resources = az resource list
$Resources | Where type -in "Microsoft.ApiManagement/service"
I am trying to get list of web apps using az cli az webapp list. And when I try to get the diagnostic setting for the particular web app using az monitor diagnostic-settings list --resource-group nameRG --resource id. I dont get any information and logs and diagnostic settings are enabled for app services. I am not sure what i am doing wrong.
I am just trying to get the list of diagnostic settings for a resource. If you know better way please mention it.
Thanks
Usage:
az monitor diagnostic-settings list --resource Name --resource-group RGName --resource-type Microsoft.Web/sites
Or:
az monitor diagnostic-settings list --resource ID
Make sure the resource id correct like this format:
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
You could get the resource id by this command:
az webapp show --name MyWebapp --resource-group MyResourceGroup
We have a situation where we want to automate the logic app creation and update. We are writing a powershell to automate the deployment.
We are trying to deploy the logic app in our integration service environment.
How do we use the --integration-service-environment parameter ?
we cannot find any example on the web nor useful documentation.
In our powershell, we have the last line as follow:
az logic workflow create --resource-group $resgrp --integration-service-environment $iseName --location $location --name $logicappname --definition $appTemplatePath --state $state
This gets us usage error: --integration-service-environment [KEY=VALUE ...]
Help?
You should use 'id= <Resource id>' as the parameter value for --integration-service-environment
The resource id is usually found in the portal.
Try the below snippet
#Your resource id will be in this format
$ise = 'id= /subscriptions/<SUB_ID>/resourceGroups/<RESOURCEgroup>/providers/Microsoft.Logic/integrationServiceEnvironments/<ISE_NAME>'
#your earlier command with modification of the ise value.
az logic workflow create --resource-group $resgrp --name $logicappname --definition $appTemplatePath --location $location --integration-service-environment $ise
Note :
Ensure,location of the logic app and ise are the same.
I have a function app in Azure that has several functions defined. According to this document, I can use AzureCLI to disable a function in a function app. When I run az functionapp config appsettings set --name $functionAppName --resource-group $resourceGroupName --settings AzureWebJobs.myFunction.Disabled=true it creates the name value pair in application settings as stated in the documentation, but the state of the function does not toggle according to the value I set. Is something else required to toggle the state of the function when I run the AzureCLI commmand?
According to the comments, the problem was solved. OP change the azure function runtime from 1.x to 2.x and then it can be disabled by running this command.
az functionapp config appsettings set --name $functionAppName --resource-group $resourceGroupName --settings AzureWebJobs.myFunction.Disabled=true
Update1:
Update2:
For this problem, I confirmed with azure support team. They provided me with the response below:
They found the feature of az function app config part was released at Sep. 2018, and at that time runtime v1 was already quite out of date. So it is possible that the product team only develops for the runtime v2.
In a word, we can just do this operation on v2 and v3, or use Azure Portal UI.
For the guys who use the runtime 1.x but wanna enable/disable function by Azure CLI. According to the document, it shows:
So the workflow is:
Click APP Service Editor.
Comment out disabled field on function.json.
Run below command again.
az functionapp config appsettings set --name $functionAppName --resource-group $resourceGroupName --settings AzureWebJobs.myFunction.Disabled=true
This function will reference the app setting to determine it status.