In this video, Sharon shows how to implement the Azure Batch service using the Azure Resource Manager portal. In addition, she also demonstrates configuring storage and adding batch pools.
- [Instructor] Now that we've talked a little bit about Azure Batch, let's go ahead and create an Azure Batch account and take a look at it. As you can see, I've already signed into Azure. I have a resource group here called LIL Batch. And I'm going to go ahead and open the blade for LIL Batch. And you'll notice that we do not have any resources within this resource group. Let's go ahead and add a Batch account. To do so, click on add. Search for Batch, and we're going to go ahead and select Batch service.
The Batch service blade will open, providing us with some information about the Batch service. Go ahead and click on create. We need to go ahead and add in a unique account name for our Batch account. Select your subscription, your resource group, and your location. I'm also going to add in a storage account. You can use one that you already have, as long as it's in the same subscription and in the same location, or you can go ahead and create new.
I'm going to go ahead and create a new one. Provide a name for your storage account. I'm not going to be very creative, and I'm going to use the same name as the Batch account. You'll notice that we can only select standard Azure performance. And then we can go ahead and change our replication strategy. For our demonstration, I'm going to go ahead and use a locally redundant storage. Click okay. Now we can choose our pool allocation mode. We can either select the Batch service or the user subscription.
You'll notice if I select user subscription, we also have to configure a key vault. We'll also need to assign a contributor role to this service. For our demonstration, we're going to go ahead and use a Batch service. Go ahead, click create. This will take a few moments for the Batch service to be created, as well as that storage account. There we go. Our deployment has succeeded. I'm going to go ahead and close down our blades. We'll pop back into that resource group, and I'm going to go ahead and click refresh.
And you'll notice that a Batch account and a storage account have been created for me. Let's go ahead and explore the Batch account. You'll notice that we have the URL for our Batch account. But I'd like to focus in on the pools, and you'll find those under features. We don't have any pools as of yet. If we want, we can go ahead and create one. I'm going to click on add to do so. Enter in a pool ID, the display name, if you wish, and then the image type.
Remember, we selected a service batch. Therefore, if I click on custom image, you'll notice that we cannot use custom images within this pool. I'm going to go ahead and select on marketplace. Pick your publisher. I'm going to pick a Windows server. Our SKU, I'm going to work with 2012 R2. I can enable automatic updates for that server, if I wish. Please note, this is for Windows systems only.
And I can go ahead and select software that's already available to us, if I want to. I just wanted to point this out for our example. We're not going to select anything here. Next, we're going to pick our node. And if you're using this for high performance computing, then you're going to want to be using some of the higher end nodes. But for our purpose, I'm just going to go ahead and select an A1. Next, we can configure the scaling.
We can have a fixed mode for scaling or an auto-scale. We can select the dedicated number of nodes, and if I would like to leverage this with low priority VMs or nodes, I can also do so. Our resize timeout is the time in minutes for the resize operation to time out. I'm going to leave it at 10. Next, we have a startup task. In this case, it's disabled, but I could go ahead and enable it. And this will allow us to run tasks on the node at startup.
And here, you'd enter in the command line to do so. I'm going to go ahead, click on disable. We have some optional settings here, as well. I'd like to point out the task scheduling policy. And this is the distribution of tasks. So we can either spread out the task evenly by selecting spread, or if we'd like to stack on as many tasks as possible onto a node, we would choose pack. We can select internode communication, if we wanted to do so.
I'm going to go ahead and click on no, and we can select application packages and certificates. We'll be talking a little bit more about applications in an upcoming lesson. You can go ahead and click on okay. And our pool is being created. You do see from our summary that we do have some nodes created. You'll also notice that this is still resizing. You'll notice as those VMs are provisioned, they're turning gray. They're sitting there idle.
As our last two nodes are starting up, let's go ahead and explore the pool in a little bit more depth. If we click on nodes, we'll see here that we have all of our nodes that we've just created in that pool. You'll also notice that some of them are still in that starting mode, and some of them are now idle as we see from our summary page. You'll notice as soon as we pop back into that overview, we have an information message letting us know that the specified account has reached its core quota.
And this is because I'm using a pay-as-you-go service and I already have X number of cores within that service. Therefore, let's go ahead and actually scale our pool down. I'm going to go ahead, click on scale. I'm going to drop our target dedicated nodes down to five. I'm going to go ahead, click on save. Going to close our information window. Oh, there it goes all by itself. I'm going to go ahead and close down this blade, as well.
And you'll notice here, we now have 15 nodes leaving that pool. And it'll take a few moments for those nodes to leave. While that's happening, let's go ahead and add a job. And remember, the job is the part of the batch that actually gets work done. Let's go ahead and add a job number. I'm going to keep it simple and just give it an ID of one. We could enter a display name, if we wished. We can select the pool that we want to assign this job to.
It already selected pool number one, because that's the only one I have, but I could go ahead and add in additional pools, if i wanted to do so. The job manager task is where we go ahead and configure that specific pass to run on that node. Again, we provide an ID, and the command line. This is the action that we want to process on that node. And again, you could fill out the rest of this, as required. I'm going to go ahead and close this for our demonstration today.
How many times would you want that task retried? If necessary, you can assign a priority to your tasks. And down at the bottom, what do you want to happen when that task completes? Is there no action to take, or do you want to terminate the job? As well as what action do you want to take if the task fails? Again, you have the option for no action or perform exit options job action. You can go ahead and click on okay. And then that job will be successfully created, and that's all there is to creating a Batch account, setting up a pool, and creating a job in tasks.
- Creating compute-intensive applications
- Creating long-running applications
- Implementing messaging systems
- Azure Service Bus relays
- Using Azure Storage queues
- Creating an Azure Event Hub
- Creating Azure WebJobs
- Managing cloud environments with Azure Active Directory Domain Services