Problem in connection to Microsoft Azure storage from Jenkins without device code

17774893 0 Reputation points
2023-06-01T07:18:35.2266667+00:00

Hi,

I tried to connect the Microsoft Azure storage blob through Jenkins by using connect-Azconnect after installing the necessary plugins in Jenkins. Can you please confirm if any other configuration is required in the system or where its stopping to connect the azure storage?

User's image

User's image

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,529 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
Windows for business Windows Server User experience PowerShell
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,746 Reputation points
    2023-06-06T10:44:31.1533333+00:00

    Hello,

    Thank you for your question and for reaching out with your question today.

    To connect to Microsoft Azure storage blob through Jenkins using the Connect-AzAccount cmdlet, you need to ensure that you have performed the necessary configuration steps. Here are some key points to check:

    1. Azure CLI Installation: Verify that Azure CLI is installed on the system where Jenkins is running. The Azure CLI provides the necessary command-line tools to interact with Azure resources. You can install Azure CLI by following the official documentation for your operating system.
    2. Azure CLI Login: Before using Connect-AzAccount, you need to authenticate and log in to Azure using Azure CLI. Open a terminal or command prompt and run the following command: az login Follow the authentication prompts and sign in with your Azure credentials. This will establish the connection to your Azure subscription.
    3. Jenkins Configuration: a. Install Azure CLI Plugin: In Jenkins, make sure you have installed the Azure CLI Plugin. This plugin integrates Azure CLI into Jenkins and provides build steps to run Azure CLI commands. b. Configure Azure CLI in Jenkins: In Jenkins, go to "Manage Jenkins" -> "Configure System" and find the section for "Azure CLI". Here, provide the path to the Azure CLI executable. By default, the path should be /usr/local/bin/az on Linux/macOS or C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\az.exe on Windows.
    4. Jenkins Job Configuration: In your Jenkins job, add a build step to execute the Azure CLI commands. For example, you can use a "Execute shell" or "Execute Windows batch command" build step, and then run the Connect-AzAccount cmdlet to establish the Azure connection. Make sure you're running the Jenkins job on the system where Azure CLI is installed and configured.
    5. Verify Connection: Run your Jenkins job and check the console output for any errors or issues. Make sure the job successfully connects to Azure using Connect-AzAccount.
    6. Additional Permissions: Ensure that the Azure account used to log in has the necessary permissions to access and interact with the Azure storage blob. The account should have appropriate roles assigned, such as Storage Blob Data Contributor or similar, depending on your requirements.

    By following these steps and verifying each configuration point, you should be able to connect to Azure storage blob through Jenkins using Connect-AzAccount.

    If the reply was helpful, please don’t forget to upvote or accept as answer.

    Best regards.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.