Automation Archives - Impulz Technologies LLC https://impulztech.com/tag/automation/ Microsoft Dynamics and Power Platform consulting company Wed, 24 Apr 2024 09:08:52 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 https://impulztech.com/wp-content/uploads/2022/08/cropped-impulz-tech-32x32.png Automation Archives - Impulz Technologies LLC https://impulztech.com/tag/automation/ 32 32 Optimizing Azure Workloads: Automate VM Startup and Shutdown https://impulztech.com/optimizing-azure-workloads-automate-vm-startup-and-shutdown/ Wed, 24 Apr 2024 09:06:48 +0000 https://impulztech.com/?p=3667 Pre-Requisite Azure Active Subscription (https://portal.azure.com/) Basic Scripting Introduction to Azure Virtual Machines (VMs) Azure Virtual Machines (VMs) serve as the backbone of countless applications and services hosted on Microsoft’s cloud platform. Offering unparalleled flexibility and scalability, Azure VMs empower businesses to deploy a wide range of computing solutions, from simple web applications to complex enterprise […]

The post Optimizing Azure Workloads: Automate VM Startup and Shutdown appeared first on Impulz Technologies LLC.

]]>

Pre-Requisite
  • Azure Active Subscription (https://portal.azure.com/)

  • Basic Scripting

Introduction to Azure Virtual Machines (VMs)

Azure Virtual Machines (VMs) serve as the backbone of countless applications and services hosted on Microsoft’s cloud platform. Offering unparalleled flexibility and scalability, Azure VMs empower businesses to deploy a wide range of computing solutions, from simple web applications to complex enterprise workloads. These virtualized instances provide on-demand access to computing resources, enabling organizations to swiftly adapt to fluctuating demands without the overhead of managing physical hardware. With Azure VMs, users can choose from a diverse selection of operating systems and configurations, tailoring their environments to meet specific requirements. Whether for development, testing, or production environments, Azure VMs offer a reliable and cost-effective solution for modern cloud computing needs. By automating VM startup and shutdown we can not only optimize the cost but our workloads too.

Importance of Automation in VM Management:

Automating virtual machine (VM) management tasks is crucial for modern cloud environments like Azure. With the ever-growing scale and complexity of cloud deployments, manual management becomes impractical and error-prone.By automate VM startup, shutdown, and scaling, enabling organizations to operate more efficiently, reduce human error, and focus on strategic initiatives. By implementing automation, businesses can ensure consistent performance, optimize resource utilization, and enhance overall productivity.

Benefits of Auto Start and Auto Shutdown Policies:

Auto Start and Auto Shutdown policies offer significant benefits in Azure VM management. Firstly, they enable organizations to optimize costs by automatically starting VMs only when needed, preventing unnecessary usage and expense. Conversely, auto shutdown ensures resources are not left running idle, reducing waste and lowering operational costs. Additionally, these policies enhance reliability and security by ensuring VMs are consistently available during business hours and safely powered off during non-operational times. Overall, Auto Start and Auto Shutdown policies play a pivotal role in maximizing efficiency, minimizing costs, and maintaining a well-orchestrated Azure environment.

Configuring Auto Start for Azure VMs:

Here are the detail steps to configure the auto-start VM in Azure:

  • In Azure, First go to Automation Accounts resource and click on create a new resource.

  • You have to give your automation account name, resource group and select the region and subscription in which your VM’s are placed and click on create.

  • After the resource has been created go to it’s overview page and from there you can find different options in sidebar, look for Runbook, select it and then click on create a new runbook button.

  • Give runbook a name, select python workflow as a runbook type. Select its available version and click on create button.

  • Now in Automation Account page search for schedules in a sidebar and click on create a new schedule.

  • On create a schedule page, you can give your schedule a name and the date in which you want to start schedule and modified it according to your needs.

  • Now in runbooks, go to the runbook which you have just created. Click on edit btton at the top, so we can write our modified script in there.

  • Write the following script, change the resource group name and vm name according to your environment. After test it and publish it by clicking on publish button.

  • Now just click on schedule in runbook page and then click on add a schedule button. And select the schedule which you just had created.

  • Now your auto-start runbook is done and it runs on assigned schedule you can check the results in jobs section. In the runbook sidebar to see the output of the runbook process and its done!

Implementing Auto Shutdown for Azure VMs:

  • Log in to the Azure Portal  and navigate to the Virtual Machines blade.

  • Choose the virtual machine for which you want to set up auto shutdown.

  • In the virtual machine’s menu, select “Auto-shutdown” under the Operations section.

  • In the Auto-shutdown blade, toggle the “Auto-shutdown” switch to enable the feature. Then, specify the desired shutdown time and time zone. Optionally, you can set a notification to alert users before shutdown.

  • Once you’ve configured the auto shutdown settings according to your requirements. Click the “Save” button to apply the changes.

Conclusion:

In conclusion, By automate VM startup and shutdown processes of Azure VMs brings numerous benefits to organizations utilizing cloud infrastructure. By implementing Auto Start and Auto Shutdown policies, businesses can optimize resource utilization, reduce costs, enhance reliability, and improve overall operational efficiency. These policies streamline routine tasks, mitigate human error, and ensure that VMs are available when needed while minimizing waste during idle periods. Through the deployment of automation, organizations can focus their efforts on strategic initiatives rather than mundane maintenance tasks, ultimately driving innovation and competitiveness in the cloud era.

You can checkout our further blogs by going to this link: Blogs

HAPPY LEARNING !

The post Optimizing Azure Workloads: Automate VM Startup and Shutdown appeared first on Impulz Technologies LLC.

]]>
How To Setup A Connection Between Azure DevOps & LCS https://impulztech.com/how-to-setup-a-connection-between-azure-devops-lcs/ Mon, 23 Oct 2023 12:21:59 +0000 https://impulztech.com/?p=3231 Transferring software deployable packages to the Asset Library is actively enabled by the connection between DevOps and LCS. Here I am describing each step in detail that how can you setup connection between Azure DevOps & LCS so it will be easy for you to deploy your dynamics packages easily in LCS Environment. 1-Workflow: After […]

The post How To Setup A Connection Between Azure DevOps & LCS appeared first on Impulz Technologies LLC.

]]>

Transferring software deployable packages to the Asset Library is actively enabled by the connection between DevOps and LCS. Here I am describing each step in detail that how can you setup connection between Azure DevOps & LCS so it will be easy for you to deploy your dynamics packages easily in LCS Environment.

1-Workflow:

After you configure an Azure DevOps subscription in Microsoft Dynamics Lifecycle Services (LCS), you can use LCS to deploy developer VMs or build/test VMs. LCS configures a developer VM, which can be linked to an Azure DevOps project. Additionally, LCS sets up a build VM, automatically associating it with an Azure DevOps project. This build VM includes a build agent/controller responsible for compiling modules from the Azure DevOps project and executing automated tests through an external validation endpoint. This workflow includes an LCS deployment of a developer VM and a build/test VM in Azure.

  • LCS creates developer and the build/test environments in Azure. To create a build/test environment, LCS must be able to determine where the source code for the Azure DevOps project is.
  • Developer works on source code on the developer VM, and the work is synced to the Azure DevOps project.
  • The build process synchronizes the code from Azure DevOps onto the build/test VM and produces deployable packages that you can apply to sandbox and production environments. The source code doesn’t flow directly from the development VM to the build/test VM. They are synced through Azure DevOps.

1.1-Create a new Azure DevOps project

  • Go to https://www.visualstudio.com/.
  • Click Sign in in the upper-right corner.
  • Sign in by using an AAD account that is in the tenant that your subscription is linked to. If the browser already has your credentials, you won’t see the sign-in page and should instead click your name in the upper-right corner.
  • On the right side of the page, under Accounts, click Create a free account now.
  • Specify an account URL, and then click Create Account.
  • Name your project, and specify a process template. Your project should now be created.

2-LCS project settings: Set up Azure DevOps:

2.1-Create a personal access token

To connect to an Azure DevOps project, LCS is authenticated by using a personal access token. Follow these steps to create a personal access token in Azure DevOps.

  • Go to https://www.visualstudio.com, sign in, and find your Azure DevOps project.
  • In the upper-right corner, hold the pointer over your name, and then, on the menu that appears, select Security.
  • Select Add to create a new personal access token.
  • Enter a name for the token, and then specify how long the token should last.
  • Select Create Token.
  • Copy the token to your clipboard.

2.2-Configure your LCS project to connect to Azure DevOps

  • In this step we see how to setup connection between Azure DevOps & LCS
  • In your LCS project, select the Project settings tile.
  • Select Azure DevOps, and then select Setup Azure DevOps. This configuration is required by many LCS tools. If you’ve already configured LCS to connect to your Azure DevOps project, you can either skip this procedure or select Change to change the existing configuration.
  • Enter the root URL for your Azure DevOps account, and the personal access token that you created earlier, and then select Continue.
  • Select your Azure DevOps project.
  • LCS requires entering the Azure DevOps root URL in the legacy format. The legacy format is and .
  • Specify the mapping between LCS/BPM items and the associated Azure DevOps work item types.
  • Select Continue, review your changes, and then select Save.

3-Set up Azure Service Connection in Azure DevOps:

3.1-Create an App Registration

  • Now create a new “App Registration” under Azure Active Directory with a name like “D365 – DevOps to LCS”
  • Under “Supported account Types” please select “Accounts in this organizational directory only (“Your company” only – Single tenant) 
  • Now click “Registrer”
  • Create an app registration and make a note of the Application (Client) Id.
  • Proceed to the ‘Authentication’ section within the app registration.
  • Choose ‘Yes’ for the option to ‘Treat the application as a public client.’
  • You can adjust this setting before moving on to ‘Add a platform’ if necessary..
  • When you now “Add a platform” select the “Mobile and Desktop application”
  • Set a checkmark by the native URL … and click on ‘Configure’
  • Now ‘Save’ your “App Registration”
  • Now open the “API permissions” and “Add a permission”
  • Click on the tab ‘APIs my organization uses” and search for “Dynamics”, select “Dynamics Lifecycle services”
  • Now select “Delegated permissions” make sure the checkmark is set by permissions at “user_impersonation” and click “Add permissions”
  • Now click on “Grant admin consent for <Your Company>” and select ‘Yes’

3.2-Create the Service Connection in DevOps

To create a service connection in DevOps it is required that you have installed the extension “Dynamics 365 Finances and Operations tools” (it’s free) into the DevOps, you can find it here:

https://marketplace.visualstudio.com/items?itemName=Dyn365FinOps.dynamics365-finops-tools

Once it is installed you can verify it by going to the Organization settings and in extension column like this

Now open you Project settings in your DevOps and select ‘Service Connections*’

Click ‘ New service connection’ and select “Dynamics Lifecycle Services” and click Next.

and now fill out the Username , Password and the Application Client Id. Click Save and you are done.

4-Set up Azure Connecter in LCS:

4.1-Create a new role in Azure Portal

  • On your Azure Portal, go to your Azure Subscription.
  • Go to IAM Settings tab, and then click create a new role button.
  • Give new role Contributor access.
  • For Assign Access to Select Azure Ad user, service principals.
  • Then select Dynamics Deployment Services [wsfed-enabled].
  • You can go to LCS and then on Project Settings column select Azure Connector.
  • Here you click Add and then simply fill the naming field of your own choice, for Subscription ID you have to add your Active Subscription ID where you had created a role and then select Yes to configure to use ARM.
  • In the Authorization Page, download the required certification file for authenticating LCS with your Azure Environment.
  • Navigate to the ‘Management Certificates’ tab in your Azure Subscription and upload the certificate acquired from LCS, which will serve as the authentication credential. After the successful upload of the certificate, go back to your LCS environment.
  • Click ‘Next,’ select your preferred region, and finally, click ‘Connect’ to complete the setup.

In this way we setup connection between Azure DevOps & LCS Environment and setup the pre-requisite of our Build and Development Environment in Azure DevOps.

The post How To Setup A Connection Between Azure DevOps & LCS appeared first on Impulz Technologies LLC.

]]>