No subscriptions were found for 'None' after az login why is this? - azure-cli

I have a project where I have admin rights and several pipelines in this project, I want to learn what can I do with azure cli and learn to work with it, so far I've installed it and used the
'az login' command, and the login was successful but when I use 'az group list' it says I have no suscriptions something like that, someone knows what am I missing? im completely new to azure cli sorry if the question seems dumb
is it possible to:
execute a pipeline from the cli?
schedule a pipeline?
and pretty much manage pipelines?
that's what I want to achieve with azure cli
Thank you for all your help

when I use 'az group list' it says I have no subscriptions something like that, someone knows what am I missing?
The command az group list list resource groups in the azure subscription, the error means your login account does not have a role in the subscription, you need to add it to the subscription as a role first, e.g. Contributor, just navigate to the subscription in the portal -> Access control (IAM) -> Add, follow this link.
If you can make sure your user account is already in a subscription, after login, use az account set --subscription <subscription-id> to set the subscription.
is it possible to: execute a pipeline from the cli? schedule a pipeline? and pretty much manage pipelines? that's what I want to achieve with azure cli
Yes, you can. To use Azure DevOps CLI, you need to add devops extension first, for more details about the install and configuration, refer to Get started with Azure DevOps CLI.
az extension add --name azure-devops
After that, use the commands here - az pipelines, e.g. use az pipelines run to execute a pipeline , use az pipelines update to update the YAML file path to configure schedules for pipelines.

Related

Using Azure CLI to manage API Management (APIM) Users, Products, Certificates, APIs

It seems that this page contains all the functionality that Azure CLI supports in regard to Azure API Management. But it doesn't show how to manage entities such as users, products, certificates, subscriptions, and APIs using Azure CLI.
Does Azure CLI lack these functionalities or is there a way to manage those entities using Azure CLI? Can Azure CLI be considered as a replacement for ARM templates in the case of APIM?
Azure CLI is missing those. Please raise on aka.ms/apimwish
According to my research, the Azure CLI API management command is in preview. SO it will miss some commands. For more details, please refer to the document. So if you want to manage Azure API management entities such as users, products, certificates, subscriptions, and APIs, I suggest you use Azure PowerShell to do that : https://learn.microsoft.com/en-us/powershell/module/az.apimanagement/?view=azps-3.0.0.
The Azure CLI currently seems to support this, see here for Microsoft docs. Make sure you upgrade your CLI to the latest version to be able to leverage this.
To get the CLI docs:
az apim --help

Is there a way to programmatically configure azure EasyAuth for AAD for an Azure Function App?

I am writing Azure CLI scripts to automate creating cloud-side components in Microsoft Azure. In particular, I am using the CLI to create Azure Function Apps. However, while I am able to create a Function App using the CLI, I have not been able to identify a way to configure authentication against Azure Active Directory, other than by using the Azure Portal user interface (see https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad for a description of the interactive process).
It's clear that the interactive process performs several steps behind the scenes, including creating an AAD Application registration and associating the registration with the Function App. My questions are:
What are details of the steps performed?
Is there a programmatic way, either with the CLI or some other interface, to perform the same set of steps?
Easy Auth is actually a module on IIS. You can enable it using Azure CLI:
az webapp auth update -g myResourceGroup -n myUniqueApp --enabled true \
--action LoginWithAzureActiveDirectory \
--aad-allowed-token-audiences https://webapp_name.azurewebsites.net/.auth/login/aad/callback \
--aad-client-id ecbacb08-df8b-450d-82b3-3fced03f2b27 --aad-client-secret very_secret_password \
--aad-token-issuer-url https://sts.windows.net/54826b22-38d6-4fb2-bad9-b7983a3e9c5a/
https://learn.microsoft.com/en-us/cli/azure/webapp/auth?view=azure-cli-latest#az_webapp_auth

How to run openshift online in Command promt Mac

I have a free trail account of openshift online. I have created an node application and a jenkins pipeline, now I want to add this to github webhooks, so I want to create a webhook. Usually when I use minishift I use oc describe bc/mynode. but how do I connect command prompt to openshift online
From the web console, select the (?) menu top right and then select 'Command Line Tools'. It gives you the command in there to login. You can then use 'oc' commands.
If new to OpenShift, also read the free eBook:
https://www.openshift.com/deploying-to-openshift/
which explains such details.

How do you start a Dataflow template from a Compute Engine instance?

From my workstation I can fire templated Dataflow jobs with the gcloud dataflow jobs command. The required authorization to insert a new job come from my workstation where I'm logged in.
On the Compute Engine instance I rely on it's service account. The one with (number)-compute#. Within the AIM section I enabled Dataflow/Dataflow Admin, Dataflow/Dataflow Developer and Dataflow/Dataflow Worker for this service account to be safe.
I even added Cloud Dataflow Service Agent when I came across that one.
Then I try to start a Dataflow from the command line but I get an error about insufficient authentication scopes: ERROR: (gcloud.dataflow.jobs.run) PERMISSION_DENIED: Request had insufficient authentication scopes.
If I do a gcloud config auth and login with my personal account, of course, it works.
Somehow I'm missing the proper permissions to set to the applied service account.
Is there a guideline I missed? Can somebody please point me into the right direction?
The error message indicates that the instance does not setup access scope properly. To launches a job from a GCE VM, the VM must have compute.read-only, compute, or cloud-platform scope for the project.
The way to verify it is using the command "gcloud compute instances describe --zone=[zone][instance]" and look for "scopes".
This document and this existing question may provide useful guidelines for you.

Error when execute gcloud

I have error when I run google cloud command, this is the error message which I get
$ gcloud compute instances list
NAME ZONE MACHINE_TYPE INTERNAL_IP EXTERNAL_IP STATUS
ERROR: (gcloud.compute.instances.list) Some requests did not succeed:
- Access Not Configured. The API is not enabled for your project, or there is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your configuration.
I have two machine running and I already updated to new version.
I don't know if you are encountering this problem, but if you specify the project name instead of the project ID when you do "gcloud config set project " then you will currently get the "Access Not Configured" error. I've pointed it out on the #gcloud IRC so hopefully it gets fixed. There may be other issues like this so it is best to ensure your parameters are sane.
If your project hasn't been marked for abuse and/or deletion, you have to enable 'Google Compute Engine' API in the Developers Console to solve the problem.
Configure your project using following command
gcloud config set project <project-id>
This is the exact API we need to enable in order to get rid of this error
Compute Engine API